package org.wmq.taskschedule.factory;

import org.springframework.beans.BeanUtils;
import org.wmq.taskschedule.algorithm.AlgorithmExecutor;
import org.wmq.taskschedule.algorithm.BilateralFilterExecutor;
import org.wmq.taskschedule.biz.model.DO.Param;

/**
 * 双边滤波算法执行器工厂类
 * 实现AlgorithmExecutorFactory接口，用于创建BilateralFilterExecutor实例
 */
public class BilateralFilterExecutorFactory implements AlgorithmExecutorFactory {
    private static final BilateralFilterExecutorFactory instance = new BilateralFilterExecutorFactory();

    private BilateralFilterExecutorFactory() {}
    
    /**
     * 获取工厂实例
     * @return BilateralFilterExecutorFactory实例
     */
    public static BilateralFilterExecutorFactory getInstance() {
        return instance;
    }
    
    @Override
    public AlgorithmExecutor getAlgorithmExecutor(Param param) {
        BilateralFilterExecutor bilateralFilterExecutor = new BilateralFilterExecutor();
        BeanUtils.copyProperties(param, bilateralFilterExecutor);
        return bilateralFilterExecutor;
    }
}